package JavaSE.CODE.javaCollection;

import java.util.ArrayList;

public class ArrayListDemo {
    public static void main(String[] args) {
        ArrayList arrayList = new ArrayList<>();
        //1、添加元素
        Student student = new Student("liudehua",18);
        Student student1 = new Student("guofucheng",18);
        Student student2 = new Student("liangchaowei",18);
        arrayList.add(student);
        arrayList.add(student1);
        arrayList.add(student2);
        arrayList.add(student2);//可以重复添加
        System.out.println(arrayList.size());
        System.out.println(arrayList.toString());
        //2、删除元素
        arrayList.remove(student);
        //arrayList.remove(new Student("liudehua",18));
        System.out.println(arrayList.size());
    }
}
